<script setup lang="ts">
  import AppIcon from '@/components/common/app/AppIcon.vue';
  import { useTranslate } from '@/hooks/core/useTranslate';
  const { changeTranslate, translateMenu } = useTranslate();
</script>

<template>
  <el-dropdown trigger="click" @command="changeTranslate">
    <template #default>
      <div>
        <AppIcon
          class="text-xl cursor-pointer text-gray-700 dark:text-text-dark"
          icon="bi:translate"
        />
      </div>
    </template>
    <template #dropdown>
      <el-dropdown-menu class="dark:bg-header-bg-dark">
        <el-dropdown-item v-for="item in translateMenu" :key="item.type" :command="item.type">
          <span class="dark:text-menu-text-dark">{{ item.title }}</span>
        </el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</template>

<style lang="scss"></style>
